<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<div class="aui-fullpage">
    <div class="overview-tag aui-gutter-column-md">
        <lv-group [lvColumns]='["122px", "auto"]' lvRowGutter="24px" class="group-mgr">
            <div class="snapshot-brand"></div>
            <lv-group lvGutter="8px" lvDirection='vertical'>
                <h1>{{'common_snapshot_management_restoration_label' | i18n}}</h1>
                <span class="aui-text-label desc-font">
                    {{'explore_snapshot_help_label' | i18n}}
                </span>
            </lv-group>
        </lv-group>
        <lv-group lvGutter="56px" class="statistic-group">
            <lv-group lvGutter="8px" lvDirection='vertical'>
                <h1 class="summary-count">
                    {{totalResource}}
                </h1>
                <span class="aui-text-label desc-font">
                    {{'explore_resource_objects_label' | i18n}}
                </span>
            </lv-group>
            <lv-group lvGutter="8px" lvDirection='vertical'>
                <h1 class="summary-count">{{totalInfected}}</h1>
                <span class="aui-text-label desc-font">
                    {{'explore_infected_resource_label' | i18n}}
                </span>
            </lv-group>
            <lv-group lvGutter="8px" lvDirection='vertical'>
                <h1 class="summary-count">{{totalUnInfected}}</h1>
                <span class="aui-text-label desc-font">
                    {{'explore_uninfected_resource_label' | i18n}}
                </span>
            </lv-group>
            <lv-group lvGutter="8px" lvDirection='vertical'>
                <h1 class="summary-count">{{totalDetecting}}</h1>
                <span class="aui-text-label desc-font" [ngClass]="{'width-en':isEn}">
                    {{'explore_in_infected_resource_label' | i18n}}
                </span>
            </lv-group>
            <lv-group lvGutter="8px" lvDirection='vertical'>
                <h1 class="summary-count">{{totalNodetecte}}</h1>
                <span class="aui-text-label desc-font">
                    {{'explore_in_nodetected_resource_label' | i18n}}
                </span>
            </lv-group>
            <div class="group-line"></div>
            <lv-group lvGutter="8px" lvDirection='vertical'>
                <h1 class="summary-count">{{totalSnapshot}}</h1>
                <span class="aui-text-label desc-font">
                    {{'explore_snapshot_count_label' | i18n}}
                </span>
            </lv-group>
        </lv-group>
    </div>
    <div class="aui-block aui-paginator-container">
        <div class="aui-operation">
            <lv-group>
                <ng-container *ngIf="selectedViewType === '1'">
                    <button lv-button (click)="deleteCopyData()" [disabled]="deleteBtnDisable" pmpermission
                        pmOperation='DeletingCopy'>
                        {{ 'common_delete_label' | i18n }}
                    </button>
                </ng-container>
            </lv-group>
            <lv-group lvGutter="16px">
                <lv-search [lvFocus]="true" (lvSearch)="search($event)"
                    lvPlaceHolder="{{'common_search_type_label'|i18n:['common_resource_label'|i18n]}}">
                </lv-search>
                <lv-radio-group [(ngModel)]="selectedViewType" [lvGroupName]="'copyDataViewGroup'">
                    <lv-group>
                        <lv-radio [lvViewType]="'button'" [lvValue]="'0'" class="copy-resource-view"
                            lv-tooltip="{{'common_resource_label' | i18n}}">
                            <i lv-icon="aui-icon-resource-view" [lvColorState]='true'></i>
                        </lv-radio>
                        <lv-radio [lvViewType]="'button'" [lvValue]="'1'" class="copy-resource-view"
                            lv-tooltip={{copyDataTipLabel}}>
                            <i lv-icon="aui-icon-copy-view" [lvColorState]='true'></i>
                        </lv-radio>
                    </lv-group>
                </lv-radio-group>
                <lv-group>
                    <button class="aui-button-icon" lv-button lvSize="auto" (click)="refresh()">
                        <i lv-icon="lv-icon-refresh" [lvColorState]="true"></i>
                    </button>
                </lv-group>
            </lv-group>
        </div>
        <div class="list-container">
            <ng-container [ngSwitch]="selectedViewType">
                <ng-container *ngSwitchCase="'0'">
                    <aui-ransomware-resource-list (refreshResource)="refreshResource()"></aui-ransomware-resource-list>
                </ng-container>
                <ng-container *ngSwitchCase="'1'">
                    <aui-ransomware-snapshot-list (onSelectionChange)="selectionChange($event)"
                        (refreshSnapshot)="refreshSnapshot()">
                    </aui-ransomware-snapshot-list>
                </ng-container>
            </ng-container>
        </div>
    </div>
</div>
